//
//  PFEmptyView.m
//  CJMobile
//
//  Created by manluqiusuo on 15/9/24.
//  Copyright © 2015年 长江证券. All rights reserved.
//

#import "PFEmptyView.h"






@implementation PFEmptyView


// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}



- (id)initWithFrame:(CGRect)frame imageName:(NSString *)imageName desc:(NSString *)desc{
    
    if( self = [super initWithFrame:frame] ){
        
        self.backgroundColor = [UIColor clearColor];
        
        UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, EMPTY_VIEW_IMAGE_WIDTH, EMPTY_VIEW_IMAGE_HEIGHT)];
        imageView.image = [UIImage imageNamed:imageName];
        
        UILabel *descLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, EMPTY_VIEW_IMAGE_HEIGHT + EMPTY_VIEW_CELL_SPACE, EMPTY_VIEW_WIDTH, EMPTY_VIEW_LABEL_HEIGHT)];
        descLabel.font = EMPTY_VIEW_LABEL_FONT;
        descLabel.textColor = [UIColor darkGrayColor];
        descLabel.textAlignment = NSTextAlignmentCenter;
        descLabel.text = desc;
        
        [self addSubview:imageView];
        [self addSubview:descLabel];
   
    }
    
    return self;
}


@end
